package com.example.win.android_banduyujia.entity;

import android.net.Uri;
import android.os.Environment;

import com.example.win.android_banduyujia.BanDuApp;
import com.example.win.android_banduyujia.R;

import java.io.File;

/**
 * Created by Win on 2015/8/13.
 */
public class Constants {

    public static final String PATH_TEMP = "/bandu/images/temp/";
    public static final String PATH_DOWNLOAD = "/bandu/images/download/";
    public static final String PATH_USER_HEADER = "/bandu/images/header/";
    public static final String PATH_IMAGE_CACEH = "/bandu/images/cache/";
    // Image Path
    public  static final String  IMAGE_CAMERA_NAME = "tmp_camera.jpg";
    public  static final Uri  IMAGE_CAMERA_URI =Uri.fromFile(new File(Environment.getExternalStorageDirectory() + PATH_TEMP,IMAGE_CAMERA_NAME));

    public  static final String  IMAGE_CAPTURE_NAME = "tmp_crop";
    public  static final Uri  IMAGE_CAPTURE_URI =Uri.fromFile(new File(Environment.getExternalStorageDirectory()+ PATH_TEMP,IMAGE_CAPTURE_NAME));

    // Image size
    public static final int USER_IMAGE_SIZE_WIDTH = 320;
    public static final int USER_IMAGE_SIZE_HEIGHT = 320;

    // password and nickname length
    public static final int VALID_CODE_LENGTH = 6;
    public static final int PASSWORD_MIN_LENGTH = 6;
    public static final int NICKNAME_MIN_LENGTH = 4;

    // usersex
    public static final int SEX_MAN = 0;
    public static final int SEX_WOMAN = 1;
    public static final String SEX_MAN_SING = BanDuApp.getContext().getString(R.string.layout_data_page_text_view_man);
    public static final String SEX_WOMAN_SING = BanDuApp.getContext().getString(R.string.layout_data_page_text_view_woman);

    public static String getSexByCode(int sex) {
        switch (sex){
            case Constants.SEX_MAN:
                return  SEX_MAN_SING;
            case Constants.SEX_WOMAN:
                return  SEX_WOMAN_SING;
            default:
                return null;
        }
    }

    // project remind
    public static final int REMIND_TWO_TIME = 0;
    public static final int REMIND_ONE_TODAY = 1;
    public static final int REMIND_TWO_TODAY = 2;
    public static final String REMING_TWO_TIME_SING=BanDuApp.getContext().getString(R.string.layout_remind_activity_setting_two_times);
    public static final String REMING_ONE_TODAY_SING=BanDuApp.getContext().getString(R.string.layout_remind_activity_setting_today);
    public static final String REMING_TWO_TODAY_SING=BanDuApp.getContext().getString(R.string.layout_remind_activity_setting_two_today);
    public static String getRemind(int remind){
        switch (remind){
            case Constants.REMIND_TWO_TIME:
                return REMING_TWO_TIME_SING;
            case Constants.REMIND_ONE_TODAY:
                return REMING_ONE_TODAY_SING;
            case Constants.REMIND_TWO_TODAY:
                return REMING_TWO_TODAY_SING;
            default:
                return REMING_TWO_TIME_SING;
        }
    }
}
